/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50719
 Source Host           : localhost:3306
 Source Schema         : shiro

 Target Server Type    : MySQL
 Target Server Version : 50719
 File Encoding         : 65001

 Date: 22/07/2019 09:06:30
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for c_permission
-- ----------------------------
DROP TABLE IF EXISTS `c_permission`;
CREATE TABLE `c_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permission_id` varchar(20) NOT NULL COMMENT '权限id',
  `perms` varchar(100) NOT NULL COMMENT '权限',
  `description` varchar(255) DEFAULT NULL COMMENT '权限描述',
  `url` varchar(255) DEFAULT NULL COMMENT '权限访问路径',
  `type` int(1) DEFAULT NULL COMMENT '类型   0：目录   1：菜单   2：按钮',
  `status` int(1) NOT NULL COMMENT '状态：1有效；2删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of c_permission
-- ----------------------------
BEGIN;
INSERT INTO `c_permission` VALUES (1, '1', 'email:*', '邮箱模块的所有权限', '/email/**', NULL, 1);
INSERT INTO `c_permission` VALUES (2, '2', 'order:*', '订单管理模块的所有权限', '/order/**', NULL, 1);
INSERT INTO `c_permission` VALUES (3, '3', 'customer:*', '客户管理模块的所有权限', '/customer/**', NULL, 1);
INSERT INTO `c_permission` VALUES (4, '4', 'product:*', '产品中心模块的所有权限', '/product/**', NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for c_role
-- ----------------------------
DROP TABLE IF EXISTS `c_role`;
CREATE TABLE `c_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role_id` varchar(20) NOT NULL COMMENT '角色id',
  `name` varchar(50) NOT NULL COMMENT '角色名称',
  `description` varchar(255) DEFAULT NULL COMMENT '角色描述',
  `status` int(1) NOT NULL COMMENT '状态：1有效；2删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of c_role
-- ----------------------------
BEGIN;
INSERT INTO `c_role` VALUES (1, '1', 'root', '超管', 1);
INSERT INTO `c_role` VALUES (2, '2', 'admin', '管理员', 1);
INSERT INTO `c_role` VALUES (3, '3', 'super_ manager', '总监', 1);
INSERT INTO `c_role` VALUES (4, '4', 'manager', '主管', 1);
INSERT INTO `c_role` VALUES (5, '5', 'employee', '员工', 1);
COMMIT;

-- ----------------------------
-- Table structure for c_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `c_role_permission`;
CREATE TABLE `c_role_permission` (
  `id` int(11) NOT NULL,
  `role_id` int(11) DEFAULT NULL COMMENT '角色ID',
  `permission_id` int(11) DEFAULT NULL COMMENT '权限ID',
  `state` smallint(2) DEFAULT NULL COMMENT '是否有效 1有效     2无效',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of c_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `c_role_permission` VALUES (1, 1, 1, 1, '超管有所有权限，包括邮件模块');
INSERT INTO `c_role_permission` VALUES (2, 1, 2, 1, '超管有所有权限，包括客户模块');
INSERT INTO `c_role_permission` VALUES (3, 1, 3, 1, '超管有所有权限，包括订单模块');
INSERT INTO `c_role_permission` VALUES (4, 1, 4, 1, '超管有所有权限，包括产品中心');
INSERT INTO `c_role_permission` VALUES (5, 2, 1, 1, 'admin有所有操作权限，包括邮件模块');
INSERT INTO `c_role_permission` VALUES (6, 2, 2, 1, 'admin有所有操作权限，包括客户模块');
INSERT INTO `c_role_permission` VALUES (7, 2, 3, 1, 'admin有所有操作权限，包括邮件模块');
INSERT INTO `c_role_permission` VALUES (8, 2, 4, 1, 'admin有所有操作权限，包括邮件模块');
INSERT INTO `c_role_permission` VALUES (9, 3, 1, 1, 'super_manager有邮件模块权限');
INSERT INTO `c_role_permission` VALUES (10, 3, 2, 1, 'super_manager有客户管理模块权限');
INSERT INTO `c_role_permission` VALUES (11, 4, 1, 1, 'manager有邮件模块权限');
INSERT INTO `c_role_permission` VALUES (12, 4, 2, 1, 'manager有客户管理模块权限');
INSERT INTO `c_role_permission` VALUES (13, 5, 2, 1, 'employee有订单模块权限');
INSERT INTO `c_role_permission` VALUES (14, 3, 3, 1, 'super_manager有订单模块权限');
COMMIT;

-- ----------------------------
-- Table structure for c_user
-- ----------------------------
DROP TABLE IF EXISTS `c_user`;
CREATE TABLE `c_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) COLLATE utf8_bin NOT NULL,
  `password` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `status` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '状态：1有效；2删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of c_user
-- ----------------------------
BEGIN;
INSERT INTO `c_user` VALUES (1, 'bailun91', 'db9335272639eb1da3695899ea4c80b65601468498c314f8f96db7f735cca7a9', '');
INSERT INTO `c_user` VALUES (2, 'admin', '928bfd2577490322a6e19b793691467e', '');
INSERT INTO `c_user` VALUES (3, 'root', '31f123ba21dc3d21a9b54a7a78f65829', '');
INSERT INTO `c_user` VALUES (4, 'leader1', '4dadac96a9f0fed2e23ed2b79c7e213d', '');
INSERT INTO `c_user` VALUES (5, 'leader2', '4dadac96a9f0fed2e23ed2b79c7e213d', '');
INSERT INTO `c_user` VALUES (6, 'sales', '9734d98d39e9e16df3d62031d495758d', '');
COMMIT;

-- ----------------------------
-- Table structure for c_user_role
-- ----------------------------
DROP TABLE IF EXISTS `c_user_role`;
CREATE TABLE `c_user_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT NULL,
  `state` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '是否有效  1有效  2无效',
  `remark` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of c_user_role
-- ----------------------------
BEGIN;
INSERT INTO `c_user_role` VALUES (1, 1, 5, '1', '白鹭员工');
INSERT INTO `c_user_role` VALUES (2, 2, 2, '1', 'admin是管理员');
INSERT INTO `c_user_role` VALUES (3, 3, 1, '1', 'root是超管');
INSERT INTO `c_user_role` VALUES (4, 4, 3, '1', 'leader1是总监');
INSERT INTO `c_user_role` VALUES (5, 5, 4, '1', 'leader2是主管');
INSERT INTO `c_user_role` VALUES (6, 6, 5, '1', 'sales是员工');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
